package com.hzx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hzx.OrderItem;
import com.hzx.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface UserMapper extends BaseMapper<User> {

    @Select("select activity.a_id, key_word,title from activity,orderTable where u_id=#{uId} and activity.a_id=orderTable.a_id")
    List<OrderItem> searchOrder(int uId);

    @Select("select u_id from user where name=#{name} and password=#{password}")
    Integer searchUser(@Param("name") String name, @Param("password") String password);

    @Override
    int insert(User user);

}
